#! /bin/sh
. ~/.bashrc

cd /home/hadoop/access

date='17-04-02'
enddate='17-04-13'

enddate=`date -d "+1 day $enddate" +%y-%m-%d`

echo "------------------------------"
echo "date=$date"
echo "enddate=$enddate"
echo "------------------------------"


while [[ $date < $enddate  ]]
do
        echo $date
		
		tarFile="/home/hadoop/access/backuplog/access_20${date//-/}.tgz"
		if [ -f /home/hadoop/access/backuplog/access_20${date//-/}.tgz ];then
			echo "1,if"
		else
        	echo "1,else"
		fi
		
		tarFile="/home/hadoop/useraction/backuplog/useraction_$date.tgz"
		if [ -f /home/hadoop/useraction/backuplog/useraction_$date.tgz ];then
			echo "2,if"
		else
			echo "2,else"
		fi
        date=`date -d "+1 day $date" +%y-%m-%d`
done
